import logging
from logging.handlers import RotatingFileHandler


def configure_logging():
    logger = logging.getLogger('py_env_logger')
    logger.setLevel(logging.DEBUG)

    file_handler = RotatingFileHandler('py_env.log', maxBytes=10000, backupCount=1)
    file_handler.setLevel(logging.DEBUG)

    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    file_handler.setFormatter(formatter)

    logger.addHandler(file_handler)
